<?php
ob_start();
header("Cache-control: public");
header("Content-type: text/html; charset=utf-8");
session_start();
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
// Psl. sugeneruotas per?
$m1 = explode(" ", microtime()); $stime = $m1[1] + $m1[0];

require_once("variklis/bendras.php");



####################### Puslapiu aprasymas ###################
if (isset($url['id']) && !empty($url['id']) && isnum($url['id'])) { $id = (int)$url['id']; } else { $id = 0; }
if (isset($id) && isnum($id) && $id > 0) {
	if ($id >= 11 && $id<=18) { $page = "funkcijos"; }
     	elseif ($id == 5) { $page = "puslapiai/apie"; }
     	elseif ($id == 6) { $page = "puslapiai/siustis"; }
     	elseif ($id == 9) { $page = "puslapiai/nuorodos"; }
     	elseif ($id == 7) { $page = "puslapiai/codebin"; }
     	elseif ($id == 22) { $page = "puslapiai/straipsnis"; }
     	elseif ($id == 25) { $page = "puslapiai/frm"; }
     	elseif ($id == 40) { $page = "puslapiai/online"; }
     	elseif ($id == 41) { $page = "puslapiai/reg"; }
     	elseif ($id == 43) { $page = "puslapiai/logout"; }
     	elseif ($id == 44) { $page = "puslapiai/edit_user"; }
     	elseif ($id == 45) { $page = "puslapiai/pm"; }
     	elseif ($id == 46) { $page = "puslapiai/dievai/index"; }
     	elseif ($id == 47) { $page = "puslapiai/view_user"; }
     	elseif ($id == 48) { $page = "puslapiai/test"; }
     	elseif ($id == 49) { $page = "puslapiai/deze"; }
     	elseif ($id == 50) { $page = "puslapiai/naujienos"; }
     	elseif ($id == 66) { $page = "puslapiai/forumas"; }
     	elseif ($id > 999) { $sql = mysql_fetch_assoc(mysql_query("SELECT page FROM projektai WHERE id=" . escape($id) ."")); $page = "projektai/" . $sql['page']; }
	else { $page = "puslapiai/klaida"; }
}
else { $page = "puslapiai/naujienos"; }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<meta name="Description" content="<?=$conf['Pavadinimas'].' - '.$conf['Apie']?>" />
<title><?=$conf['Pavadinimas']." - " .$page?></title>
<link href="stilius/stilius.css" rel="stylesheet" type="text/css" media="all"/>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="javascript/pngfix.js"></script>
<![endif]-->
<script type="text/javascript" src="javascript/tooltips.js"></script>
<? if (isset($url['id']) && $url['id'] == 46 && (isset($url['a']) && ($url['a'] == 2 || $url['a'] == 1))) { ?><script language="javascript" type="text/javascript" src="javascript/htmlarea/tiny_mce/tiny_mce.js"></script><? } ?>
<script type="text/javascript" src="javascript/countdown.js" defer="defer"></script>
<script language="javascript" src="javascript/pagrindinis.php" type="text/javascript"></script>
<script type="text/javascript" language="javascript" src="rate/js/behavior.js"></script>
<script src="javascript/SpryMenuBar.js" type="text/javascript"></script>

<?php include_once("priedai/header.php"); ?>
</head>
<NOSCRIPT>
 <? klaida("Klaida","Prašome įjunkite javascript palaikymą"); ?>
</NOSCRIPT>
<body onload="setInterval('blinkIt()',500);">
<script language="javascript" src="javascript/boxover.js" type="text/javascript"></script>
<div class="main">
  <table width="100%" border="0">
    <tr>
      <td colspan="2">
	<!--<h4><?=$conf['Pavadinimas']?></h4> -->
       <a href="/"><img src="images/468_60.png" alt="<?=$conf['Pavadinimas']?>" border="0"/></a>
      </td>
    </tr>
    <tr>
      <td width="170" valign="top">
			<?php
			$sql_p = mysql_query("SELECT * FROM `panel` WHERE `align`='L' AND `show`='Y' ORDER BY `place` ASC");
			while ($row_p = mysql_fetch_assoc($sql_p)) {
				if (is_file("blokai/".$row_p['file'])) { include ("blokai/".$row_p['file']); }
				else { lentele("Klaida","Tokio bloko nėra",$row_p['file']); }
			}
			unset($sql_p,$row_p);
			?>

		</td>
      <td valign="top">
		<div class="title">Šiuo metu svetainėje: <?=$online?></div>
		<div class="vidus">
		<?php
			include("blokai/sms_reklama.php");
			if (!isset($_SESSION['username'])) {
			 	lentele($conf['Pavadinimas'],$conf['Apie']);
			}
			include("".$page.".php");
		?>
		</div>
		<?php hide("Reklama","<a href='http://www.mrcbug.com' target='_blank' title='Coders - atviras kodas Lietuvai'><img src='http://www.mrcbug.com/mrcbug.gif' border='0' alt='mrcbug.com' align='left' hspace='10'/></a> <textarea rows=\"3\" style=\"width: 300px;\">&lt;a href='http://www.mrcbug.com' target='_blank' title='Coders - atviras kodas Lietuvai'&gt;&lt;img src='http://www.mrcbug.com/mrcbug.gif' border='0' alt='mrcbug.com' /&gt;&lt;/a&gt;</textarea>",true,"Mūsų 88x31px baneris"); ?>
	  </td>
	  <?php
	  unset($text);
	  // Jei zmogus prisijunges tuo met rodomas desinysis MENIU
	  //if (isset($_SESSION['username'])) {
	  	echo "
	  		<td width=170 valign=top>";
			$sql_d = mysql_query("SELECT * FROM `panel` WHERE `align`='R' AND `show`='Y' ORDER BY `place` ASC");
			while ($row_d = mysql_fetch_assoc($sql_d)) {
				if (is_file("blokai/".$row_d['file'])) { include ("blokai/".$row_d['file']); }
				else { lentele("Klaida","Tokio bloko nėra",$row_d['file']); }
			}
			unset($sql_d,$row_d);
	  	echo "
	  		</td>
	  	";
	  //}
	  unset($text);
	  
	  ?>
    </tr>
  </table>
</div>
<?php
$m2 = explode(" ", microtime());
$etime = $m2[1] + $m2[0];
$ttime = ($etime - $stime);
$ttime = number_format($ttime, 7);
if ($conf['Render'] == 1) { $ttime = "Sugeneruotas per: ".apvalinti($ttime,2)."s." ; }
else { $ttime = ''; }
copyright("$ttime\n".$conf['Copyright']."");
if (defined("LEVEL") && LEVEL > 20) { copyright("Mysql uzklausu: $mysql_num"); }
unset($extra,$meniu,$text,$ttime);
?>

</body>
</html>
